<template>
  <el-form-item prop="modbusAddress" label="Bit位">
    <el-select v-model="optionModel.bit" class="radio-group-custom">
      <el-option
        v-for="option in bitOptions"
        :key="option.value"
        :label="option.label"
        :value="option.value"
      />
    </el-select>
  </el-form-item>
</template>

<script>
const getBitOptions = () => {
  const options = []
  while (options.length < 16) {
    options.push({ label: `BIT${options.length}`, value: options.length })
  }
  return options
}

export default {
  name: 'BitEditor',
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object
  },
  data() {
    return {
      bitOptions: getBitOptions()
    }
  }
}
</script>

<style scoped></style>
